Behavioral data were collected in 2 pilots and 1 main experiment, whereas in the last experiment participants were asked to passively view the stream of faces.
Pilot 1
- flickering frequency: 15 Hz
- regularity: 5 Hz
- 9 face identities
- task: detect dots on faces
# subset data
behav.pilot1 <- behav.data %>%
filter(experiment == "pilot1") %>%
dplyr::select(-variability) %>%
droplevels() %>%
mutate(condition = as.factor(gsub("_NA", "", condition)))
pilot1.model <- brm(RTs ~ 0 + condition # constant effects
+ (0 + condition | participant), # varying effects
data = behav.pilot1, # subset data current experiment
family = gaussian(), # likelihood function
prior = weak.priors, # priors
sample_prior = TRUE, # draw samples from the prior distribution
inits = "0", # initial parameter values in the chains
control = list(
adapt_delta = .99, # parameters of NUTS sampler
max_treedepth = 15
),
chains = num.chains, # number of chains
iter = num.iter, # number of iterations
warmup = num.warmup, # number of warm-up samples
thin = num.thin, # thinning rate
algorithm = "sampling", # type of sampling algorithm
cores = num.chains, # number of processor cores to use when running chains in parallel
seed = seed.smorfia # RNG seed
)
saveRDS(pilot1.model, file = "pilot1_model.rds", compress = "gzip") # save results
# subset data
behav.pilot1 <- behav.data %>%
filter(experiment == "pilot1") %>%
dplyr::select(-variability) %>%
droplevels() %>%
mutate(condition = as.factor(gsub("_NA", "", condition)))
# load model
pilot1.model <- readRDS("pilot1_model.rds")
# summary posterior distributions & diagnostics
summary.pilot1.model <-
describe_posterior(pilot1.model,
centrality = "mean",
ci = 0.95,
ci_method = "hdi",
test = NULL,
diagnostic = "all"
) %>%
mutate(
Parameter = gsub("b_condition", "", Parameter),
Parameter2 = gsub("_", " ", Parameter),
condition = factor(Parameter2,
levels =
c(
"upright angry", "upright neutral", "upright irregular",
"inverted angry", "inverted neutral", "inverted irregular"
)
)
) %>%
dplyr::select(Parameter, Mean, HDI95_Low = CI_low, HDI95_High = CI_high, Estimated_Sample_Size = ESS, MonteCarlo_StdErr = MCSE)
kable(summary.pilot1.model, digits = 2)
| inverted_angry |
437.1 |
420.4 |
452.2 |
7273 |
0.09 |
| inverted_irregular |
443.3 |
427.5 |
459.4 |
8041 |
0.09 |
| inverted_neutral |
438.1 |
422.9 |
453.1 |
8575 |
0.08 |
| upright_angry |
437.9 |
426.4 |
449.4 |
8374 |
0.06 |
| upright_irregular |
432.3 |
418.9 |
445.4 |
10495 |
0.07 |
| upright_neutral |
439.0 |
424.1 |
453.0 |
8191 |
0.08 |


pilot1.posterior.test <- pilot1.model %>%
spread_draws(`b_.*`, regex = TRUE) %>%
dplyr::select(
"upright angry" = "b_conditionupright_angry",
"upright neutral" = "b_conditionupright_neutral",
"upright irregular" = "b_conditionupright_irregular",
"inverted angry" = "b_conditioninverted_angry",
"inverted neutral" = "b_conditioninverted_neutral",
"inverted irregular" = "b_conditioninverted_irregular"
) %>%
mutate(
### orientation (upright minus inverted)
# angry
diff.angry.uprightVSinverted = `upright angry` - `inverted angry`,
# neutral
diff.neutral.uprightVSinverted = `upright neutral` - `inverted neutral`,
# irregular
diff.irregular.uprightVSinverted = `upright irregular` - `inverted irregular`,
### regularity
## upright
# angry minus neutral
diff.upright.angryVSneutral = `upright angry` - `upright neutral`,
# angry minus irregular
diff.upright.angryVSirregular = `upright angry` - `upright irregular`,
# neutral minus irregular
diff.upright.neutralVSirregular = `upright neutral` - `upright irregular`,
## inverted
# angry minus neutral
diff.inverted.angryVSneutral = `inverted angry` - `inverted neutral`,
# angry minus irregular
diff.inverted.angryVSirregular = `inverted angry` - `inverted irregular`,
# neutral minus irregular
diff.inverted.neutralVSirregular = `inverted neutral` - `inverted irregular`
) %>%
gather(key = "condition", value = "RTs") %>%
filter(condition == c("diff.angry.uprightVSinverted",
"diff.neutral.uprightVSinverted",
"diff.irregular.uprightVSinverted",
"diff.upright.angryVSneutral",
"diff.upright.angryVSirregular",
"diff.upright.neutralVSirregular",
"diff.inverted.angryVSneutral",
"diff.inverted.angryVSirregular",
"diff.inverted.neutralVSirregular")) %>%
droplevels() %>%
mutate(condition = factor(condition,
levels = c("diff.angry.uprightVSinverted",
"diff.neutral.uprightVSinverted",
"diff.irregular.uprightVSinverted",
"diff.upright.angryVSneutral",
"diff.upright.angryVSirregular",
"diff.upright.neutralVSirregular",
"diff.inverted.angryVSneutral",
"diff.inverted.angryVSirregular",
"diff.inverted.neutralVSirregular"))
)
# summary
summary.pilot1.posterior.test <- pilot1.posterior.test %>%
group_by(condition) %>%
dplyr::summarize(
mean = mean(RTs),
hdi.95.low = hdi(RTs)[1],
hdi.95.high = hdi(RTs)[2],
evidence.ratio = ifelse(mean < 0,
length(which(RTs < 0)) / length(which(RTs > 0)),
length(which(RTs > 0)) / length(which(RTs < 0))
)
) %>%
ungroup()
kable(summary.pilot1.posterior.test, digits = 2)
| diff.angry.uprightVSinverted |
0.48 |
-13.05 |
15.83 |
1.11 |
| diff.neutral.uprightVSinverted |
0.79 |
-16.08 |
17.58 |
1.17 |
| diff.irregular.uprightVSinverted |
-11.13 |
-25.50 |
6.98 |
11.61 |
| diff.upright.angryVSneutral |
-1.11 |
-12.50 |
10.74 |
1.38 |
| diff.upright.angryVSirregular |
5.59 |
-5.15 |
17.56 |
5.49 |
| diff.upright.neutralVSirregular |
6.76 |
-7.88 |
21.54 |
4.97 |
| diff.inverted.angryVSneutral |
-0.59 |
-16.85 |
16.31 |
1.11 |
| diff.inverted.angryVSirregular |
-6.34 |
-23.32 |
11.93 |
3.36 |
| diff.inverted.neutralVSirregular |
-5.23 |
-17.23 |
6.12 |
4.61 |
### Paired comparisons ###
par(mfrow = c(3, 3))
for(i in 1:length(levels(pilot1.posterior.test$condition))) {
temp.data <- filter(pilot1.posterior.test, condition == levels(condition)[i])
plotPost(
pull(temp.data, RTs),
credMass = 0.95,
compVal = 0,
ROPE = NULL,
xlab = "",
col = "#b3cde0",
showCurve = FALSE,
cex = 1,
main = levels(temp.data$condition)[i]
)
}

Take-home message:
- irregular: slightly slower RTs for inverted compared to upright faces
Pilot 2
- flickering frequency: 15 Hz
- regularity: 5 Hz
- 2 face identities
- task: detect dots on faces
# subset data
behav.pilot2 <- behav.data %>%
filter(experiment == "pilot2")
pilot2.model <- brm(RTs ~ 0 + condition
+ (0 + condition | participant),
data = behav.pilot2,
family = gaussian(),
prior = weak.priors,
sample_prior = TRUE,
inits = "random",
control = list(
adapt_delta = .99,
max_treedepth = 15
),
chains = num.chains,
iter = num.iter,
warmup = num.warmup,
thin = num.thin,
algorithm = "sampling",
cores = num.chains,
seed = seed.smorfia
)
saveRDS(pilot2.model, file = "pilot2_model.rds", compress = "gzip")
# subset data
behav.pilot2 <- behav.data %>%
filter(experiment == "pilot2")
# load model
pilot2.model <- readRDS("pilot2_model.rds")
# summary posterior distributions & diagnostics
summary.pilot2.model <-
describe_posterior(pilot2.model,
centrality = "mean",
ci = 0.95,
ci_method = "hdi",
test = NULL,
diagnostic = "all"
) %>%
mutate(
Parameter = gsub("b_condition", "", Parameter),
Parameter2 = gsub("_", " ", Parameter),
condition = factor(Parameter2,
levels =
c(
"upright angry high", "upright neutral high", "upright irregular high",
"upright angry low", "upright neutral low", "upright irregular low",
"inverted angry high", "inverted neutral high", "inverted irregular high",
"inverted angry low", "inverted neutral low", "inverted irregular low"
)
)
) %>%
dplyr::select(Parameter, Mean, HDI95_Low = CI_low, HDI95_High = CI_high, Estimated_Sample_Size = ESS, MonteCarlo_StdErr = MCSE)
kable(summary.pilot2.model, digits = 2)
| 10 |
upright_angry_low |
547.2 |
520.6 |
575.0 |
12524 |
0.12 |
| 16 |
upright_neutral_low |
522.4 |
492.5 |
552.5 |
12025 |
0.14 |
| 13 |
upright_irregular_low |
521.6 |
490.4 |
554.1 |
12563 |
0.15 |
| 14 |
upright_irregular_low |
521.6 |
490.4 |
554.1 |
12563 |
0.15 |
| 2 |
inverted_angry_low |
559.5 |
531.6 |
587.3 |
13287 |
0.12 |
| 8 |
inverted_neutral_low |
525.1 |
494.6 |
555.8 |
12763 |
0.14 |
| 5 |
inverted_irregular_low |
592.8 |
549.1 |
637.3 |
13369 |
0.19 |
| 6 |
inverted_irregular_low |
592.8 |
549.1 |
637.3 |
13369 |
0.19 |
| 9 |
upright_angry_high |
553.2 |
525.0 |
580.7 |
12673 |
0.13 |
| 15 |
upright_neutral_high |
564.9 |
536.2 |
594.1 |
13611 |
0.13 |
| 11 |
upright_irregular_high |
577.6 |
510.7 |
642.1 |
12878 |
0.30 |
| 12 |
upright_irregular_high |
577.6 |
510.7 |
642.1 |
12878 |
0.30 |
| 1 |
inverted_angry_high |
540.5 |
510.4 |
570.6 |
13191 |
0.13 |
| 7 |
inverted_neutral_high |
544.4 |
512.2 |
577.3 |
13380 |
0.14 |
| 3 |
inverted_irregular_high |
583.2 |
528.8 |
634.3 |
13746 |
0.23 |
| 4 |
inverted_irregular_high |
583.2 |
528.8 |
634.3 |
13746 |
0.23 |
# MCMC chains
pilot2.model %>%
spread_draws(`b_.*`, regex = TRUE) %>%
dplyr::select(
"Chain" = ".chain",
"upright angry high" = "b_conditionupright_angry_high",
"upright neutral high" = "b_conditionupright_neutral_high",
"upright irregular high" = "b_conditionupright_irregular_high",
"upright angry low" = "b_conditionupright_angry_low",
"upright neutral low" = "b_conditionupright_neutral_low",
"upright irregular low" = "b_conditionupright_irregular_low",
"inverted angry high" = "b_conditioninverted_angry_high",
"inverted neutral high" = "b_conditioninverted_neutral_high",
"inverted irregular high" = "b_conditioninverted_irregular_high",
"inverted angry low" = "b_conditioninverted_angry_low",
"inverted neutral low" = "b_conditioninverted_neutral_low",
"inverted irregular low" = "b_conditioninverted_irregular_low"
) %>%
as.data.frame() %>%
mcmc_trace(facet_args = list(ncol = 3)) +
geom_vline(
xintercept = seq(0, 2000, 500),
linetype = "dotted",
colour = "#999999",
size = .8,
alpha = .5
) +
ggtitle("chain convergence") +
theme_EmoSSR


# posterior densities
pilot2.model %>%
gather_draws(`b_.*`, regex = TRUE) %>%
mutate(condition = recode(factor(.variable),
"b_conditionupright_angry_high" = "upright angry high",
"b_conditionupright_neutral_high" = "upright neutral high",
"b_conditionupright_irregular_high" = "upright irregular high",
"b_conditionupright_angry_low" = "upright angry low",
"b_conditionupright_neutral_low" = "upright neutral low",
"b_conditionupright_irregular_low" = "upright irregular low",
"b_conditioninverted_angry_high" = "inverted angry high",
"b_conditioninverted_neutral_high" = "inverted neutral high",
"b_conditioninverted_irregular_high" = "inverted irregular high",
"b_conditioninverted_angry_low" = "inverted angry low",
"b_conditioninverted_neutral_low" = "inverted neutral low",
"b_conditioninverted_irregular_low" = "inverted irregular low"
)) %>%
dplyr::select(condition, RTs = .value) %>%
mutate(condition = factor(condition,
levels = c(
"upright angry high", "upright neutral high", "upright irregular high",
"upright angry low", "upright neutral low", "upright irregular low",
"inverted angry high", "inverted neutral high", "inverted irregular high",
"inverted angry low", "inverted neutral low", "inverted irregular low"
)
)) %>%
ggplot(aes(y = condition, x = RTs)) +
geom_halfeyeh(fill = "#b3cde0", .width = .95) +
ggtitle("posterior densities") +
theme_minimal(base_size = 18) +
theme(
strip.text = element_text(
hjust = .5,
size = 24
),
plot.title = element_text(size = 22, hjust = .5)
)

### observed vs. predicted data ###
behav.pilot2 %>%
mutate(predicted = predict(pilot2.model)[, 1]) %>%
dplyr::rename(observed = RTs) %>%
gather(key = data_type, value = RTs, observed:predicted) %>%
ggplot(aes(
x = cond4plot,
y = RTs,
color = variability,
fill = variability
)) +
geom_pirate(
bars = FALSE,
cis = TRUE,
lines = TRUE, lines_params = list(color = "black"),
points = TRUE, points_params = list(shape = 16, size = 5, alpha = .2),
violins = TRUE, violins_params = list(size = 1),
show.legend = TRUE
) +
scale_fill_viridis_d(option = "cividis") +
scale_color_viridis_d(option = "cividis") +
scale_y_continuous(
limits = c(0, 800),
breaks = seq(0, 800, 100)
) +
coord_cartesian(ylim = c(200, 800)) +
geom_hline(
yintercept = seq(0, 800, 100),
linetype = "dotted",
colour = "#999999",
size = .8,
alpha = .5
) +
labs(
x = "",
y = "ms"
) +
facet_wrap(~ data_type, scales = "free") +
ggtitle("pilot 2") +
theme_EmoSSR

pilot2.posterior.test <- pilot2.model %>%
spread_draws(`b_.*`, regex = TRUE) %>%
dplyr::select(
"upright angry high" = "b_conditionupright_angry_high",
"upright neutral high" = "b_conditionupright_neutral_high",
"upright irregular high" = "b_conditionupright_irregular_high",
"upright angry low" = "b_conditionupright_angry_low",
"upright neutral low" = "b_conditionupright_neutral_low",
"upright irregular low" = "b_conditionupright_irregular_low",
"inverted angry high" = "b_conditioninverted_angry_high",
"inverted neutral high" = "b_conditioninverted_neutral_high",
"inverted irregular high" = "b_conditioninverted_irregular_high",
"inverted angry low" = "b_conditioninverted_angry_low",
"inverted neutral low" = "b_conditioninverted_neutral_low",
"inverted irregular low" = "b_conditioninverted_irregular_low"
) %>%
mutate(
### orientation
# angry high
diff.high.angry.uprightVSinverted = `upright angry high` - `inverted angry high`,
# neutral high
diff.high.neutral.uprightVSinverted = `upright neutral high` - `inverted neutral high`,
# irregular high
diff.high.irregular.uprightVSinverted = `upright irregular high` - `inverted irregular high`,
# angry low
diff.low.angry.uprightVSinverted = `upright angry low` - `inverted angry low`,
# neutral high
diff.low.neutral.uprightVSinverted = `upright neutral low` - `inverted neutral low`,
# irregular high
diff.low.irregular.uprightVSinverted = `upright irregular low` - `inverted irregular low`,
### regularity
## upright high
# angry minus neutral
diff.high.upright.angryVSneutral = `upright angry high` - `upright neutral high`,
# angry minus irregular
diff.high.upright.angryVSirregular = `upright angry high` - `upright irregular high`,
# neutral minus irregular
diff.high.upright.neutralVSirregular = `upright neutral high` - `upright irregular high`,
## upright low
# angry minus neutral
diff.low.upright.angryVSneutral = `upright angry low` - `upright neutral low`,
# angry minus irregular
diff.low.upright.angryVSirregular = `upright angry low` - `upright irregular low`,
# neutral minus irregular
diff.low.upright.neutralVSirregular = `upright neutral low` - `upright irregular low`,
## inverted high
# angry minus neutral
diff.high.inverted.angryVSneutral = `inverted angry high` - `inverted neutral high`,
# angry minus irregular
diff.high.inverted.angryVSirregular = `inverted angry high` - `inverted irregular high`,
# neutral minus irregular
diff.high.inverted.neutralVSirregular = `inverted neutral high` - `inverted irregular high`,
## inverted low
# angry minus neutral
diff.low.inverted.angryVSneutral = `inverted angry low` - `inverted neutral low`,
# angry minus irregular
diff.low.inverted.angryVSirregular = `inverted angry low` - `inverted irregular low`,
# neutral minus irregular
diff.low.inverted.neutralVSirregular = `inverted neutral low` - `inverted irregular low`,
### variability
## upright angry
diff.upright.angry.highVSlow = `upright angry high` - `upright angry low`,
## upright neutral
diff.upright.neutral.highVSlow = `upright neutral high` - `upright neutral low`,
## upright irregular
diff.upright.irregular.highVSlow = `upright irregular high` - `upright irregular low`,
## inverted angry
diff.inverted.angry.highVSlow = `inverted angry high` - `inverted angry low`,
## inverted neutral
diff.inverted.neutral.highVSlow = `inverted neutral high` - `inverted neutral low`,
## inverted irregular
diff.inverted.irregular.highVSlow = `inverted irregular high` - `inverted irregular low`
) %>%
gather(key = "condition", value = "RTs") %>%
filter(condition == c(
"diff.high.angry.uprightVSinverted",
"diff.high.neutral.uprightVSinverted",
"diff.high.irregular.uprightVSinverted",
"diff.low.angry.uprightVSinverted",
"diff.low.neutral.uprightVSinverted",
"diff.low.irregular.uprightVSinverted",
"diff.high.upright.angryVSneutral",
"diff.high.upright.angryVSirregular",
"diff.high.upright.neutralVSirregular",
"diff.low.upright.angryVSneutral",
"diff.low.upright.angryVSirregular",
"diff.low.upright.neutralVSirregular",
"diff.high.inverted.angryVSneutral",
"diff.high.inverted.angryVSirregular",
"diff.high.inverted.neutralVSirregular",
"diff.low.inverted.angryVSneutral",
"diff.low.inverted.angryVSirregular",
"diff.low.inverted.neutralVSirregular",
"diff.upright.angry.highVSlow",
"diff.upright.neutral.highVSlow",
"diff.upright.irregular.highVSlow",
"diff.inverted.angry.highVSlow",
"diff.inverted.neutral.highVSlow",
"diff.inverted.irregular.highVSlow"
)) %>%
droplevels() %>%
mutate(condition = factor(condition,
levels = c(
"diff.high.angry.uprightVSinverted",
"diff.high.neutral.uprightVSinverted",
"diff.high.irregular.uprightVSinverted",
"diff.low.angry.uprightVSinverted",
"diff.low.neutral.uprightVSinverted",
"diff.low.irregular.uprightVSinverted",
"diff.high.upright.angryVSneutral",
"diff.high.upright.angryVSirregular",
"diff.high.upright.neutralVSirregular",
"diff.low.upright.angryVSneutral",
"diff.low.upright.angryVSirregular",
"diff.low.upright.neutralVSirregular",
"diff.high.inverted.angryVSneutral",
"diff.high.inverted.angryVSirregular",
"diff.high.inverted.neutralVSirregular",
"diff.low.inverted.angryVSneutral",
"diff.low.inverted.angryVSirregular",
"diff.low.inverted.neutralVSirregular",
"diff.upright.angry.highVSlow",
"diff.upright.neutral.highVSlow",
"diff.upright.irregular.highVSlow",
"diff.inverted.angry.highVSlow",
"diff.inverted.neutral.highVSlow",
"diff.inverted.irregular.highVSlow"
)
))
# summary
summary.pilot2.posterior.test <- pilot2.posterior.test %>%
group_by(condition) %>%
dplyr::summarize(
mean = mean(RTs),
hdi.95.low = hdi(RTs)[1],
hdi.95.high = hdi(RTs)[2],
evidence.ratio = ifelse(mean < 0,
length(which(RTs < 0)) / length(which(RTs > 0)),
length(which(RTs > 0)) / length(which(RTs < 0))
)
) %>%
ungroup()
kable(summary.pilot2.posterior.test, digits = 2)
| diff.high.angry.uprightVSinverted |
14.26 |
-26.02 |
58.01 |
2.81 |
| diff.high.neutral.uprightVSinverted |
20.78 |
-21.85 |
59.68 |
5.54 |
| diff.high.irregular.uprightVSinverted |
-3.52 |
-71.89 |
93.20 |
1.18 |
| diff.low.angry.uprightVSinverted |
-13.03 |
-47.47 |
26.28 |
3.17 |
| diff.low.neutral.uprightVSinverted |
-3.75 |
-45.00 |
34.61 |
1.33 |
| diff.low.irregular.uprightVSinverted |
-71.78 |
-123.64 |
-14.71 |
132.20 |
| diff.high.upright.angryVSneutral |
-11.59 |
-53.36 |
29.25 |
2.75 |
| diff.high.upright.angryVSirregular |
-24.49 |
-88.59 |
56.67 |
3.02 |
| diff.high.upright.neutralVSirregular |
-15.05 |
-93.75 |
48.13 |
2.12 |
| diff.low.upright.angryVSneutral |
25.18 |
-12.06 |
67.21 |
9.42 |
| diff.low.upright.angryVSirregular |
25.67 |
-16.16 |
62.58 |
7.54 |
| diff.low.upright.neutralVSirregular |
0.97 |
-40.96 |
46.95 |
1.11 |
| diff.high.inverted.angryVSneutral |
-3.69 |
-44.22 |
35.52 |
1.25 |
| diff.high.inverted.angryVSirregular |
-41.42 |
-104.62 |
21.02 |
9.92 |
| diff.high.inverted.neutralVSirregular |
-40.00 |
-109.86 |
17.40 |
8.81 |
| diff.low.inverted.angryVSneutral |
32.84 |
-10.58 |
70.07 |
18.06 |
| diff.low.inverted.angryVSirregular |
-32.81 |
-84.74 |
20.69 |
7.13 |
| diff.low.inverted.neutralVSirregular |
-68.07 |
-128.91 |
-24.05 |
94.29 |
| diff.upright.angry.highVSlow |
4.77 |
-37.43 |
42.06 |
1.59 |
| diff.upright.neutral.highVSlow |
42.07 |
4.62 |
82.04 |
50.31 |
| diff.upright.irregular.highVSlow |
57.46 |
-14.80 |
129.75 |
14.88 |
| diff.inverted.angry.highVSlow |
-19.09 |
-64.26 |
18.85 |
4.41 |
| diff.inverted.neutral.highVSlow |
19.72 |
-21.72 |
67.06 |
4.17 |
| diff.inverted.irregular.highVSlow |
-9.55 |
-81.61 |
61.61 |
1.63 |
### Paired comparisons ###
### orientation
pilot2.posterior.test.orientation <- filter(
pilot2.posterior.test,
condition == c(
"diff.high.angry.uprightVSinverted",
"diff.high.neutral.uprightVSinverted",
"diff.high.irregular.uprightVSinverted",
"diff.low.angry.uprightVSinverted",
"diff.low.neutral.uprightVSinverted",
"diff.low.irregular.uprightVSinverted"
)
) %>%
droplevels()
par(mfrow = c(2, 3))
for (i in 1:length(levels(pilot2.posterior.test.orientation$condition))) {
temp.data <- filter(pilot2.posterior.test.orientation, condition == levels(condition)[i])
plotPost(
pull(temp.data, RTs),
credMass = 0.95,
compVal = 0,
ROPE = NULL,
xlab = "",
col = "#b3cde0",
showCurve = FALSE,
cex = 1,
main = levels(temp.data$condition)[i]
)
}

### regularity
pilot2.posterior.test.regularity <- filter(
pilot2.posterior.test,
condition == c(
"diff.high.upright.angryVSneutral",
"diff.high.upright.angryVSirregular",
"diff.high.upright.neutralVSirregular",
"diff.low.upright.angryVSneutral",
"diff.low.upright.angryVSirregular",
"diff.low.upright.neutralVSirregular",
"diff.high.inverted.angryVSneutral",
"diff.high.inverted.angryVSirregular",
"diff.high.inverted.neutralVSirregular",
"diff.low.inverted.angryVSneutral",
"diff.low.inverted.angryVSirregular",
"diff.low.inverted.neutralVSirregular"
)
) %>%
droplevels()
par(mfrow = c(4, 3))
for (i in 1:length(levels(pilot2.posterior.test.regularity$condition))) {
temp.data <- filter(pilot2.posterior.test.regularity, condition == levels(condition)[i])
plotPost(
pull(temp.data, RTs),
credMass = 0.95,
compVal = 0,
ROPE = NULL,
xlab = "",
col = "#b3cde0",
showCurve = FALSE,
cex = 1,
main = levels(temp.data$condition)[i]
)
}

### variability
pilot2.posterior.test.variability <- filter(
pilot2.posterior.test,
condition == c(
"diff.upright.angry.highVSlow",
"diff.upright.neutral.highVSlow",
"diff.upright.irregular.highVSlow",
"diff.inverted.angry.highVSlow",
"diff.inverted.neutral.highVSlow",
"diff.inverted.irregular.highVSlow"
)
) %>%
droplevels()
par(mfrow = c(2, 3))
for (i in 1:length(levels(pilot2.posterior.test.variability$condition))) {
temp.data <- filter(pilot2.posterior.test.variability, condition == levels(condition)[i])
plotPost(
pull(temp.data, RTs),
credMass = 0.95,
compVal = 0,
ROPE = NULL,
xlab = "",
col = "#b3cde0",
showCurve = FALSE,
cex = 1,
main = levels(temp.data$condition)[i]
)
}

Take-home message:
- paired comparisons:
- orientation
- slower RTs for inverted compared to upright irregular faces when within-identity emotion variability is low
- regularity
- slightly slower RTs for angry compared to neutral inverted faces when within-identity emotion variability is low
- slower RTs for irregular compared to neutral inverted faces when within-identity emotion variability is low
- within-identity emotion variability
- upright neutral: slower RTs for high compared to low within-identity emotion variability
- upright irregular: slightly slower RTs for high compared to low within-identity emotion variability
Exp 1
- flickering frequency: 6 Hz
- regularity: 2 Hz
- 2 face identities
- task: detect dots on faces
# subset data
behav.exp1 <- behav.data %>%
filter(experiment == "exp1")
exp1.model <- brm(RTs ~ 0 + condition
+ (0 + condition | participant),
data = behav.exp1,
family = gaussian(),
prior = weak.priors,
sample_prior = TRUE,
inits = "random",
control = list(
adapt_delta = .99,
max_treedepth = 15
),
chains = num.chains,
iter = num.iter,
warmup = num.warmup,
thin = num.thin,
algorithm = "sampling",
cores = num.chains,
seed = seed.smorfia
)
saveRDS(exp1.model, file = "exp1_model.rds", compress = "gzip")
# subset data
behav.exp1 <- behav.data %>%
filter(experiment == "exp1")
# load model
exp1.model <- readRDS("exp1_model.rds")
# summary posterior distributions & diagnostics
summary.exp1.model <-
describe_posterior(exp1.model,
centrality = "mean",
ci = 0.95,
ci_method = "hdi",
test = NULL,
diagnostic = "all"
) %>%
mutate(
Parameter = gsub("b_condition", "", Parameter),
Parameter2 = gsub("_", " ", Parameter),
condition = factor(Parameter2,
levels =
c(
"upright angry high", "upright neutral high", "upright irregular high",
"upright angry low", "upright neutral low", "upright irregular low",
"inverted angry high", "inverted neutral high", "inverted irregular high",
"inverted angry low", "inverted neutral low", "inverted irregular low"
)
)
) %>%
dplyr::select(Parameter, Mean, HDI95_Low = CI_low, HDI95_High = CI_high, Estimated_Sample_Size = ESS, MonteCarlo_StdErr = MCSE)
kable(summary.exp1.model, digits = 2)
| 10 |
upright_angry_low |
518.3 |
478.8 |
558.4 |
12347 |
0.18 |
| 16 |
upright_neutral_low |
512.2 |
471.4 |
553.0 |
12836 |
0.18 |
| 13 |
upright_irregular_low |
483.6 |
443.5 |
523.3 |
12527 |
0.18 |
| 14 |
upright_irregular_low |
483.6 |
443.5 |
523.3 |
12527 |
0.18 |
| 2 |
inverted_angry_low |
488.6 |
448.5 |
528.7 |
12168 |
0.19 |
| 8 |
inverted_neutral_low |
551.5 |
510.1 |
590.3 |
12425 |
0.18 |
| 5 |
inverted_irregular_low |
538.8 |
495.8 |
580.8 |
12858 |
0.19 |
| 6 |
inverted_irregular_low |
538.8 |
495.8 |
580.8 |
12858 |
0.19 |
| 9 |
upright_angry_high |
504.5 |
462.3 |
544.6 |
13040 |
0.18 |
| 15 |
upright_neutral_high |
511.2 |
473.9 |
551.4 |
12864 |
0.17 |
| 11 |
upright_irregular_high |
562.3 |
519.7 |
602.4 |
12501 |
0.19 |
| 12 |
upright_irregular_high |
562.3 |
519.7 |
602.4 |
12501 |
0.19 |
| 1 |
inverted_angry_high |
525.4 |
485.1 |
567.9 |
12845 |
0.19 |
| 7 |
inverted_neutral_high |
514.6 |
476.5 |
555.8 |
12908 |
0.18 |
| 3 |
inverted_irregular_high |
551.6 |
508.6 |
591.5 |
12503 |
0.19 |
| 4 |
inverted_irregular_high |
551.6 |
508.6 |
591.5 |
12503 |
0.19 |
# MCMC chains
exp1.model %>%
spread_draws(`b_.*`, regex = TRUE) %>%
dplyr::select(
"Chain" = ".chain",
"upright angry high" = "b_conditionupright_angry_high",
"upright neutral high" = "b_conditionupright_neutral_high",
"upright irregular high" = "b_conditionupright_irregular_high",
"upright angry low" = "b_conditionupright_angry_low",
"upright neutral low" = "b_conditionupright_neutral_low",
"upright irregular low" = "b_conditionupright_irregular_low",
"inverted angry high" = "b_conditioninverted_angry_high",
"inverted neutral high" = "b_conditioninverted_neutral_high",
"inverted irregular high" = "b_conditioninverted_irregular_high",
"inverted angry low" = "b_conditioninverted_angry_low",
"inverted neutral low" = "b_conditioninverted_neutral_low",
"inverted irregular low" = "b_conditioninverted_irregular_low"
) %>%
as.data.frame() %>%
mcmc_trace(facet_args = list(ncol = 3)) +
geom_vline(
xintercept = seq(0, 2000, 500),
linetype = "dotted",
colour = "#999999",
size = .8,
alpha = .5
) +
ggtitle("chain convergence") +
theme_EmoSSR +
theme(legend.position = "none")


exp1.posterior.test <- exp1.model %>%
spread_draws(`b_.*`, regex = TRUE) %>%
dplyr::select(
"upright angry high" = "b_conditionupright_angry_high",
"upright neutral high" = "b_conditionupright_neutral_high",
"upright irregular high" = "b_conditionupright_irregular_high",
"upright angry low" = "b_conditionupright_angry_low",
"upright neutral low" = "b_conditionupright_neutral_low",
"upright irregular low" = "b_conditionupright_irregular_low",
"inverted angry high" = "b_conditioninverted_angry_high",
"inverted neutral high" = "b_conditioninverted_neutral_high",
"inverted irregular high" = "b_conditioninverted_irregular_high",
"inverted angry low" = "b_conditioninverted_angry_low",
"inverted neutral low" = "b_conditioninverted_neutral_low",
"inverted irregular low" = "b_conditioninverted_irregular_low"
) %>%
mutate(
### orientation
# angry high
diff.high.angry.uprightVSinverted = `upright angry high` - `inverted angry high`,
# neutral high
diff.high.neutral.uprightVSinverted = `upright neutral high` - `inverted neutral high`,
# irregular high
diff.high.irregular.uprightVSinverted = `upright irregular high` - `inverted irregular high`,
# angry low
diff.low.angry.uprightVSinverted = `upright angry low` - `inverted angry low`,
# neutral high
diff.low.neutral.uprightVSinverted = `upright neutral low` - `inverted neutral low`,
# irregular high
diff.low.irregular.uprightVSinverted = `upright irregular low` - `inverted irregular low`,
### regularity
## upright high
# angry minus neutral
diff.high.upright.angryVSneutral = `upright angry high` - `upright neutral high`,
# angry minus irregular
diff.high.upright.angryVSirregular = `upright angry high` - `upright irregular high`,
# neutral minus irregular
diff.high.upright.neutralVSirregular = `upright neutral high` - `upright irregular high`,
## upright low
# angry minus neutral
diff.low.upright.angryVSneutral = `upright angry low` - `upright neutral low`,
# angry minus irregular
diff.low.upright.angryVSirregular = `upright angry low` - `upright irregular low`,
# neutral minus irregular
diff.low.upright.neutralVSirregular = `upright neutral low` - `upright irregular low`,
## inverted high
# angry minus neutral
diff.high.inverted.angryVSneutral = `inverted angry high` - `inverted neutral high`,
# angry minus irregular
diff.high.inverted.angryVSirregular = `inverted angry high` - `inverted irregular high`,
# neutral minus irregular
diff.high.inverted.neutralVSirregular = `inverted neutral high` - `inverted irregular high`,
## inverted low
# angry minus neutral
diff.low.inverted.angryVSneutral = `inverted angry low` - `inverted neutral low`,
# angry minus irregular
diff.low.inverted.angryVSirregular = `inverted angry low` - `inverted irregular low`,
# neutral minus irregular
diff.low.inverted.neutralVSirregular = `inverted neutral low` - `inverted irregular low`,
### variability
## upright angry
diff.upright.angry.highVSlow = `upright angry high` - `upright angry low`,
## upright neutral
diff.upright.neutral.highVSlow = `upright neutral high` - `upright neutral low`,
## upright irregular
diff.upright.irregular.highVSlow = `upright irregular high` - `upright irregular low`,
## inverted angry
diff.inverted.angry.highVSlow = `inverted angry high` - `inverted angry low`,
## inverted neutral
diff.inverted.neutral.highVSlow = `inverted neutral high` - `inverted neutral low`,
## inverted irregular
diff.inverted.irregular.highVSlow = `inverted irregular high` - `inverted irregular low`
) %>%
gather(key = "condition", value = "RTs") %>%
filter(condition == c(
"diff.high.angry.uprightVSinverted",
"diff.high.neutral.uprightVSinverted",
"diff.high.irregular.uprightVSinverted",
"diff.low.angry.uprightVSinverted",
"diff.low.neutral.uprightVSinverted",
"diff.low.irregular.uprightVSinverted",
"diff.high.upright.angryVSneutral",
"diff.high.upright.angryVSirregular",
"diff.high.upright.neutralVSirregular",
"diff.low.upright.angryVSneutral",
"diff.low.upright.angryVSirregular",
"diff.low.upright.neutralVSirregular",
"diff.high.inverted.angryVSneutral",
"diff.high.inverted.angryVSirregular",
"diff.high.inverted.neutralVSirregular",
"diff.low.inverted.angryVSneutral",
"diff.low.inverted.angryVSirregular",
"diff.low.inverted.neutralVSirregular",
"diff.upright.angry.highVSlow",
"diff.upright.neutral.highVSlow",
"diff.upright.irregular.highVSlow",
"diff.inverted.angry.highVSlow",
"diff.inverted.neutral.highVSlow",
"diff.inverted.irregular.highVSlow"
)) %>%
droplevels() %>%
mutate(condition = factor(condition,
levels = c(
"diff.high.angry.uprightVSinverted",
"diff.high.neutral.uprightVSinverted",
"diff.high.irregular.uprightVSinverted",
"diff.low.angry.uprightVSinverted",
"diff.low.neutral.uprightVSinverted",
"diff.low.irregular.uprightVSinverted",
"diff.high.upright.angryVSneutral",
"diff.high.upright.angryVSirregular",
"diff.high.upright.neutralVSirregular",
"diff.low.upright.angryVSneutral",
"diff.low.upright.angryVSirregular",
"diff.low.upright.neutralVSirregular",
"diff.high.inverted.angryVSneutral",
"diff.high.inverted.angryVSirregular",
"diff.high.inverted.neutralVSirregular",
"diff.low.inverted.angryVSneutral",
"diff.low.inverted.angryVSirregular",
"diff.low.inverted.neutralVSirregular",
"diff.upright.angry.highVSlow",
"diff.upright.neutral.highVSlow",
"diff.upright.irregular.highVSlow",
"diff.inverted.angry.highVSlow",
"diff.inverted.neutral.highVSlow",
"diff.inverted.irregular.highVSlow"
)
))
# summary
summary.exp1.posterior.test <- exp1.posterior.test %>%
group_by(condition) %>%
dplyr::summarize(
mean = mean(RTs),
hdi.95.low = hdi(RTs)[1],
hdi.95.high = hdi(RTs)[2],
evidence.ratio = ifelse(mean < 0,
length(which(RTs < 0)) / length(which(RTs > 0)),
length(which(RTs > 0)) / length(which(RTs < 0))
)
) %>%
ungroup()
kable(summary.exp1.posterior.test, digits = 2)
| diff.high.angry.uprightVSinverted |
-21.36 |
-80.45 |
40.29 |
3.30 |
| diff.high.neutral.uprightVSinverted |
-2.83 |
-61.94 |
54.26 |
1.11 |
| diff.high.irregular.uprightVSinverted |
11.26 |
-44.92 |
67.51 |
1.90 |
| diff.low.angry.uprightVSinverted |
28.80 |
-23.00 |
86.58 |
4.85 |
| diff.low.neutral.uprightVSinverted |
-39.60 |
-94.69 |
18.74 |
10.31 |
| diff.low.irregular.uprightVSinverted |
-55.50 |
-111.17 |
7.23 |
25.64 |
| diff.high.upright.angryVSneutral |
-5.05 |
-57.45 |
46.57 |
1.38 |
| diff.high.upright.angryVSirregular |
-58.29 |
-114.48 |
-7.75 |
65.70 |
| diff.high.upright.neutralVSirregular |
-50.36 |
-104.63 |
4.11 |
30.76 |
| diff.low.upright.angryVSneutral |
5.51 |
-54.08 |
57.62 |
1.41 |
| diff.low.upright.angryVSirregular |
36.40 |
-13.24 |
95.86 |
9.25 |
| diff.low.upright.neutralVSirregular |
27.69 |
-33.34 |
76.91 |
4.65 |
| diff.high.inverted.angryVSneutral |
9.66 |
-52.89 |
64.12 |
1.76 |
| diff.high.inverted.angryVSirregular |
-26.21 |
-92.34 |
28.23 |
3.69 |
| diff.high.inverted.neutralVSirregular |
-37.44 |
-93.08 |
19.43 |
8.67 |
| diff.low.inverted.angryVSneutral |
-62.82 |
-119.87 |
-7.30 |
82.38 |
| diff.low.inverted.angryVSirregular |
-50.13 |
-109.73 |
2.73 |
22.82 |
| diff.low.inverted.neutralVSirregular |
10.48 |
-51.57 |
65.02 |
1.78 |
| diff.upright.angry.highVSlow |
-14.61 |
-78.51 |
38.20 |
2.13 |
| diff.upright.neutral.highVSlow |
-1.05 |
-56.25 |
59.14 |
0.96 |
| diff.upright.irregular.highVSlow |
79.98 |
23.94 |
140.32 |
332.50 |
| diff.inverted.angry.highVSlow |
38.25 |
-25.66 |
89.45 |
11.81 |
| diff.inverted.neutral.highVSlow |
-36.27 |
-89.68 |
15.85 |
9.93 |
| diff.inverted.irregular.highVSlow |
11.19 |
-42.50 |
70.65 |
1.85 |
### Paired comparisons ###
### orientation
exp1.posterior.test.orientation <- filter(
exp1.posterior.test,
condition == c(
"diff.high.angry.uprightVSinverted",
"diff.high.neutral.uprightVSinverted",
"diff.high.irregular.uprightVSinverted",
"diff.low.angry.uprightVSinverted",
"diff.low.neutral.uprightVSinverted",
"diff.low.irregular.uprightVSinverted"
)
) %>%
droplevels()
par(mfrow = c(2, 3))
for (i in 1:length(levels(exp1.posterior.test.orientation$condition))) {
temp.data <- filter(exp1.posterior.test.orientation, condition == levels(condition)[i])
plotPost(
pull(temp.data, RTs),
credMass = 0.95,
compVal = 0,
ROPE = NULL,
xlab = "",
col = "#b3cde0",
showCurve = FALSE,
cex = 1,
main = levels(temp.data$condition)[i]
)
}

### regularity
exp1.posterior.test.regularity <- filter(
exp1.posterior.test,
condition == c(
"diff.high.upright.angryVSneutral",
"diff.high.upright.angryVSirregular",
"diff.high.upright.neutralVSirregular",
"diff.low.upright.angryVSneutral",
"diff.low.upright.angryVSirregular",
"diff.low.upright.neutralVSirregular",
"diff.high.inverted.angryVSneutral",
"diff.high.inverted.angryVSirregular",
"diff.high.inverted.neutralVSirregular",
"diff.low.inverted.angryVSneutral",
"diff.low.inverted.angryVSirregular",
"diff.low.inverted.neutralVSirregular"
)
) %>%
droplevels()
par(mfrow = c(4, 3))
for (i in 1:length(levels(exp1.posterior.test.regularity$condition))) {
temp.data <- filter(exp1.posterior.test.regularity, condition == levels(condition)[i])
plotPost(
pull(temp.data, RTs),
credMass = 0.95,
compVal = 0,
ROPE = NULL,
xlab = "",
col = "#b3cde0",
showCurve = FALSE,
cex = 1,
main = levels(temp.data$condition)[i]
)
}

### variability
exp1.posterior.test.variability <- filter(
exp1.posterior.test,
condition == c(
"diff.upright.angry.highVSlow",
"diff.upright.neutral.highVSlow",
"diff.upright.irregular.highVSlow",
"diff.inverted.angry.highVSlow",
"diff.inverted.neutral.highVSlow",
"diff.inverted.irregular.highVSlow"
)
) %>%
droplevels()
par(mfrow = c(2, 3))
for (i in 1:length(levels(exp1.posterior.test.variability$condition))) {
temp.data <- filter(exp1.posterior.test.variability, condition == levels(condition)[i])
plotPost(
pull(temp.data, RTs),
credMass = 0.95,
compVal = 0,
ROPE = NULL,
xlab = "",
col = "#b3cde0",
showCurve = FALSE,
cex = 1,
main = levels(temp.data$condition)[i]
)
}

Take-home message:
- paired comparisons:
- orientation
- slightly slower RTs for inverted compared to upright neutral faces when within-identity emotion variability is low
- slightly slower RTs for inverted compared to upright irregular faces when within-identity emotion variability is low
- regularity
- slower RTs for irregular compared to angry upright faces when within-identity emotion variability is high
- slightly slower RTs for irregular compared to neutral upright faces when within-identity emotion variability is high
- slower RTs for neutral compared to angry inverted faces when within-identity emotion variability is low
- slightly slower RTs for irregular compared to angry inverted faces when within-identity emotion variability is low
- within-identity emotion variability
- upright irregular: slower RTs for high compared to low within-identity emotion variability
- inverted angry: slightly slower RTs for high compared to low within-identity emotion variability